<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGoodsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('goods', function (Blueprint $table) {
            $table->bigIncrements('id');
            $table->integer('category_id')->default(0)->comment('0：未分类');
            $table->integer('brand_id')->default(0)->comment('0：未知品牌');
            $table->string('title')->comment('商品的名称');
            $table->integer('click_count')->default(0)->comment('商品点击数');
            $table->string('seller_note')->nullable()->comment('商品的商家备注，仅商家可见');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('goods');
    }
}
